import Vue from 'vue'
import App from './App.vue'
import router from '@/router'
import store from '@/store'

if (Vue.prototype.$cookie.get('token') && sessionStorage.getItem('routes')) {
  store.dispatch('menu/transRouter', JSON.parse(sessionStorage.getItem('routes')))
} else {
  Vue.prototype.$cookie.remove('token')
  router.push('/login')
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

Vue.config.devtools = true
Vue.config.productionTip = false
